package com.imooc.product.exception;

import com.imooc.product.enums.ResultEnum;

import lombok.Getter;

/**
 * @author jack
 * @date 2019年1月5日
 */
@Getter
public class ProductException extends RuntimeException {
	
	private static final long serialVersionUID = 1L;
	private Integer code;
	
	public ProductException(Integer code, String message) {
		super(message);
		this.code = code;
	}

	public ProductException(ResultEnum resultEnum) {
		super(resultEnum.getMessage());
		this.code = resultEnum.getCode();
	}
	
}
